<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!-- sidebar start -->
<div class="admin-sidebar am-offcanvas" id="admin-offcanvas">
    <div class="am-offcanvas-bar admin-offcanvas-bar">

        <ul class="am-list admin-sidebar-list">

            <!-- 登陆后首页 -->
            <li>
                <a href="${basePath}${sessionScope.user.roleId}/index" target="_self">
                    <span class="am-icon-home"></span>
                    管理首页
                </a>
            </li>

            <!-- 实时状态监测 -->
            <li class="admin-parent">
                <a href="${basePath}${sessionScope.user.roleId}/realtime">
                    <span class="am-icon-file"></span>
                    实时状态监测
                    <span class="am-fr am-margin-right"></span>
                </a>
            </li>

            <!-- 设备区域信息/管理 -->
<%--            <li class="admin-parent">--%>
<%--                <a href="${basePath}${sessionScope.user.roleId}/logicarea">--%>
<%--                    <span class="am-icon-file"></span>--%>
<%--                    设备区域信息/管理--%>
<%--                    <span class="am-fr am-margin-right"></span>--%>
<%--                </a>--%>
<%--            </li>--%>

            <!-- 工单派发及处理情况 -->
<%--            <li class="admin-parent">--%>
<%--                <a href="${basePath}${sessionScope.user.roleId}/gdcl">--%>
<%--                    <span class="am-icon-file"></span>--%>
<%--                    工单派发及处理情况--%>
<%--                    <span class="am-fr am-margin-right"></span>--%>
<%--                </a>--%>
<%--            </li>--%>

            <!-- 设施绑定情况-->
            <li class="admin-parent">
                <a href="${basePath}${sessionScope.user.roleId}/devbindinfo">
                    <span class="am-icon-file"></span>
                    设施绑定情况
                    <span class="am-fr am-margin-right"></span>
                </a>
            </li>

            <%-- <!-- 故障列表-->
            <li class="admin-parent">
                <a href="${basePath}${sessionScope.user.roleId}/facfault.do">
                    <span class="am-icon-file"></span>
                    硬件故障列表
                    <span class=" am-fr am-margin-right"></span>
                </a>
            </li> --%>
            <!-- 临时申请操作-->
<%--            <li class="admin-parent">--%>
<%--                <a href="${basePath}${sessionScope.user.roleId}/applyrecord">--%>
<%--                    <span class="am-icon-file"></span>--%>
<%--                    临时申请操作--%>
<%--                    <span class=" am-fr am-margin-right"></span>--%>
<%--                </a>--%>
<%--            </li>--%>
            <!-- 事件日志-->
            <li class="admin-parent">
                <a href="${basePath}${sessionScope.user.roleId}/eventlog">
                    <span class="am-icon-file"></span>
                    事件日志
                    <span class=" am-fr am-margin-right"></span>
                </a>
            </li>

            <!-- 告警记录-->
            <li class="admin-parent">
                <a href="${basePath}${sessionScope.user.roleId}/eventlog?t2=on">
                    <span class="am-icon-file"></span>
                    告警记录
                    <span class=" am-fr am-margin-right"></span>
                </a>
            </li>

            <!-- 余下工单-->
<%--            <li class="admin-parent">--%>
<%--                <a href="${basePath}${sessionScope.user.roleId}/eventlog?t1=on&jj=on">--%>
<%--                    <span class="am-icon-file"></span>--%>
<%--                    余下工单--%>
<%--                    <span class=" am-fr am-margin-right"></span>--%>
<%--                </a>--%>
<%--            </li>--%>

            <!-- 施工单位管理-->
<%--            <li class="admin-parent">--%>
<%--                <a href="${basePath}${sessionScope.user.roleId}/unitandstaff">--%>
<%--                    <span class="am-icon-file"></span>--%>
<%--                    施工单位及人员--%>
<%--                    <span class="am-fr am-margin-right"></span>--%>
<%--                </a>--%>
<%--            </li>--%>

            <!-- 施工单位工人管理-->
<%--            <li class="admin-parent">--%>
<%--                <a href="${basePath}${sessionScope.user.roleId}/jointounit">--%>
<%--                    <span class="am-icon-file"></span>--%>
<%--                    施工单位工人添加申请--%>
<%--                    <span class="am-fr am-margin-right"></span>--%>
<%--                    <span id="workers" class="am-badge am-badge-warning"></span>--%>
<%--                </a>--%>
<%--            </li>--%>

            <!-- 远程抄表-->
<%--            <li class="admin-parent">--%>
<%--                <a href="${basePath}${sessionScope.user.roleId}/copymeter">--%>
<%--                    <span class="am-icon-file"></span>--%>
<%--                    远程抄表--%>
<%--                    <span class="am-fr am-margin-right"></span>--%>
<%--                </a>--%>
<%--            </li>--%>
<%--            设备添加--%>
            <li class="admin-parent">
                <a href="${basePath}${sessionScope.user.roleId}/devadd">
                    <span class="am-icon-file"></span>
                    设备添加
                    <span class="am-fr am-margin-right"></span>
                </a>
            </li>
<%--            设备信息展示--%>
            <li class="admin-parent">
                <a href="${basePath}${sessionScope.user.roleId}/devinfos">
                    <span class="am-icon-file"></span>
                    设备信息
                    <span class="am-fr am-margin-right"></span>
                </a>
            </li>
            <!-- 报表导出-->
            <li class="admin-parent">
                <a href="javascript:void(0)">
                    <span class="am-icon-file"></span>
                    <span data-am-modal="{target: '#exportExcel', closeViaDimmer: 0, width: 800, height: 600}"
                          onclick="workerList(1,'${it.id}')">导出报表</span>
                    <span class="am-fr am-margin-right"></span>
                </a>
            </li>

            <!-- 注销登陆 -->
            <li class="admin-parent">
                <a href="${basePath}logout.do">
                    <span class="am-icon-sign-out"></span>
                    注销
                </a>
            </li>
        </ul>
    </div>
</div>

<!-- 导出报表 -->
<div class="am-modal am-modal-no-btn" tabindex="-1" id="exportExcel" style="border-radius:10px">
    <div class="am-modal-dialog">
        <div class="am-modal-hd">
            表格数据下载<a href="javascript: void(0)" class="am-close am-close-spin"
                   data-am-modal-close>&times;</a>
        </div>
        <div class="am-modal-bd" style="margin-top: 5%;" >
            <div class="am-g" style="margin-top: 3%">
            </div><br>
<%--            <div class="am-g">--%>
<%--                <div class="am-u-sm-offset-2 am-u-sm-2">--%>
<%--                      <span class="am-input-group-btn am-datepicker-add-on" style="">--%>
<%--                    <button type="button" style="float: left;border-radius:10px"  onclick="flagSetter(3)"--%>
<%--                            class="am-btn am-btn-default am-btn-xs am-text-secondary"--%>
<%--                            data-am-modal="{target: '#choseTime', closeViaDimmer: 0, width: 300, height: 200}">--%>
<%--                        水表数据下载--%>
<%--                    </button></span>--%>
<%--                    <span class="am-input-group-btn am-datepicker-add-on" style="">--%>
<%--                    <button type="button" style="float: right; margin-left: 260px; border-radius:10px"  onclick="flagSetter(4)"--%>
<%--                            class="am-btn am-btn-default am-btn-xs am-text-secondary"--%>
<%--                            data-am-modal="{target: '#choseTime', closeViaDimmer: 0, width: 300, height: 200}">--%>
<%--                        电表数据下载--%>
<%--                    </button></span>--%>
<%--                </div>--%>
<%--            </div>--%>
        </div>
            <div class="am-modal-dialog" >
                <div class="am-modal-hd">
                    选择时间起始点
                </div>

                <div class="am-modal-bd" style="width: 60%;margin: 0 auto;">
                    <br><div class="am-input-group am-datepicker-date" data-am-datepicker="{format: 'yyyy-mm-dd', viewMode: 'years'}" id="timec">
                    <input type="text" id="startTime" class="am-form-field" placeholder="请选择开始时间" readonly>
                    <span class="am-input-group-btn am-datepicker-add-on">
			    <button class="am-btn am-btn-default" type="button"><span class="am-icon-calendar"></span> </button>
			  </span>
                </div><br>
                    <br><div class="am-input-group am-datepicker-date" data-am-datepicker="{format: 'yyyy-mm-dd', viewMode: 'years'}" id="timed">
                    <input type="text" id="endTime" class="am-form-field" placeholder="请选择结束时间" readonly>
                    <span class="am-input-group-btn am-datepicker-add-on">
			    <button class="am-btn am-btn-default" type="button"><span class="am-icon-calendar"></span> </button>
			  </span>
                </div><br>
                    <input type="button" onclick="exportWaterEleExcel(4)"
                           value="下载电表"
                           class="am-btn am-btn-primary am-hide-sm-only"
                           style="float: left;margin-left:50px;border-radius: 10px;"
                           data-am-modal-close>
                    <input type="button" onclick="exportWaterEleExcel(3)"
                           value="下载水表"
                           class="am-btn am-btn-primary am-hide-sm-only"
                           style="float: right;margin-right:50px;border-radius: 10px;"
                           data-am-modal-close>
                </div>
            </div>
    </div>
</div>
<!-- 选择开始时间 -->

<div id="flag" hidden="true"></div>
<script type="text/javascript">
    function downLoadExcel(){
        var flag=$("#flag").text();
        window.location.href="${basePath}excel/file/"+flag+","+$("#startTime").val();
    }
    function exportWaterEleExcel(flag){
        var startTime=$("#startTime").val().replace("-","").replace("-","");
        var endTime=$("#endTime").val().replace("-","").replace("-","");
        window.location.href="${basePath}excel/exportdata/"+startTime+"/"+endTime+"/"+flag;
    }
    function flagSetter(flag){
        $("#flag").text(flag);
        // if('meter_dl'==flag){
        //     $('#timec').hide();
        // }else{
        //     $('#timec').show();
        // }
    }
</script>

<script type="text/javascript">
    function workersNum(){
        $.ajax({
            type : 'post',
            dataType : 'json',
            cache : false,
            url : "/ajaxworkers.do",
            success : function(data) {
                $('#workers').html(data);
            }
        });
    }
    window.setTimeout('workersNum()',10);
    function convertapplynum(){
        $.ajax({
            type : 'post',
            dataType : 'json',
            cache : false,
            url : "/ajaxapplynum.do",
            success : function(data) {
                $('#convertapply').html(data);
            }
        });
    }
    window.setTimeout('convertapplynum()',9);
</script>
<!-- sidebar end -->

